﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Com.Framework.Data;
namespace Com.Library.DB.Menu
{
	public enum MenuCategory : int
	{
		None = 0,

	}

	public class MenuModel
	{
		public static void Create(int CategoryNo, string EngName, string KorName, string Desc, string SmallImageURL, string ViewImageURL, string ManagerName)
		{
			MenuCreateArguments arg = new MenuCreateArguments();
			arg.n4CategoryNo = CategoryNo;
			arg.strEngName = EngName;
			arg.strKorName = KorName;
			arg.strDescription = Desc;
			arg.strSmallImageURL = SmallImageURL;
			arg.strViewImageURL = ViewImageURL;
			arg.strManagerName = ManagerName;

			MenuCreate sp = new MenuCreate();
			sp.SetArguments(arg);
			sp.ExecuteNonQuery();
		}

		public static void Modify(int SeqNo, string EngName, string KorName, string Desc, string SmallImageURL, string ViewImageURL, string ManagerName)
		{
			MenuModifyArguments arg = new MenuModifyArguments();
			arg.n4SeqNo = SeqNo;
			arg.strEngName = EngName;
			arg.strKorName = KorName;
			arg.strDescription = Desc;
			arg.strSmallImageURL = SmallImageURL;
			arg.strViewImageURL = ViewImageURL;
			arg.strManagerName = ManagerName;

			MenuModify sp = new MenuModify();
			sp.SetArguments(arg);
			sp.ExecuteNonQuery();
		}

		public static MenuEntity GetInfo(int SeqNo)
		{
			MenuGetInfoArguments arg = new MenuGetInfoArguments();
			arg.n4SeqNo = SeqNo;
			MenuGetInfo sp = new MenuGetInfo();
			sp.SetArguments(arg);
			MenuEntity output = sp.ExecuteNonQuery();
			return output;
		}

		public static void Remove(int SeqNo)
		{
			MenuRemoveArguments arg = new MenuRemoveArguments();
			arg.n4SeqNo = SeqNo;
			MenuRemove sp = new MenuRemove();
			sp.SetArguments(arg);
			sp.ExecuteNonQuery();
		}

		public static void SetTop(int SeqNo)
		{
			MenuSetTopArguments arg = new MenuSetTopArguments();
			arg.n4SeqNo = SeqNo;
			MenuSetTop sp = new MenuSetTop();
			sp.SetArguments(arg);
			sp.ExecuteNonQuery();
		}

		public static ListData<MenuEntity, OutputEntity> GetList(int CategoryNo, int PageNo, byte PageSize)
		{
			MenuGetListArguments arg = new MenuGetListArguments();
			arg.n4CategoryNo = CategoryNo;
			arg.PageNo = PageNo;
			arg.PageSize = PageSize;

			MenuGetList sp = new MenuGetList();
			sp.SetArguments(arg);
			List<MenuEntity> ListData = sp.Execute();
			OutputEntity OutputData = sp.GetOutput();
			ListData<MenuEntity, OutputEntity> RetValue = new ListData<MenuEntity, OutputEntity>(ListData, OutputData);

			return RetValue;
		}
	}
}
